package com.dog
/**
*首页action
*/
class HomeController{
	
	def home={
		params.max = 10
		def news = News.list(params)
		params.news = news
		render(view:"/index", collection:params)
	}
	
	def iframe={
		//取得首页狗狗滚动图片列表
		params.homeFlag = "1"
		def imgs = Img.list(params)
		params.imgs = imgs
		//取得首页狗舍描述
		def dogHouse = DogHouse.findByHomeFlag("1")
		params.dogHouse = dogHouse
		//取得首页新闻列表
		params.max = 7
		def news = News.list(params)
		params.news = news
		//取得首页公狗
		def male = Dog.findByHomeFlagAndSex("1","1")
		params.male = male
		render(view:"/indexifram", collection:params)
	}
}